package com.fishery.authority.service;

import com.fishery.authority.entity.Base;
import com.fishery.authority.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fishery.authority.entity.vo.InvitationVo;
import com.fishery.authority.entity.vo.UserLoginPassword;
import com.fishery.authority.entity.vo.UserLoginVo;
import com.fishery.authority.entity.vo.UserVo;
import com.fishery.entity.Result;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 711
 * @since 2021-01-13
 */
public interface UserService extends IService<User> {
    /**
     * 注册
     *
     * @param userVo
     */
    Result register(UserVo userVo);

    /**
     * 通过密码登陆
     *
     * @param user
     * @return
     */
    User loginByPassword(UserLoginPassword user);

    /**
     * 通过验证码登陆
     *
     * @param userLoginVo
     * @return
     */
    User loginByVerification(UserLoginVo userLoginVo);

    /**
     * 通过用户登陆的手机查找用户
     *
     * @param phone
     * @return
     */
    User findByPhone(String phone);

    /**
     * 通过用户id查找用户
     *
     * @param userId
     * @return
     */
    User findByUserId(String userId);

    /**
     * 修改用户资料
     *
     * @param user
     */
    void updateUser(User user);

    /**
     * 找回密码
     *
     * @param userModified
     * @param code
     */
    void findPassword(User userModified, String code);

    void applyForBaseAdmin(String userId, String baseId, int baseIdentity);

    Map<String, String> applyForStatus(String userId);

    void applyForAddBase(String userId, Base base);

    Base applyForAddBaseStatus(String userId);

    HashMap<String, Object> getBase(String userId);

    void inviteUserIntoBase(String userId, String baseId);

    List<InvitationVo> getInvitationRecord(String baseId);

    List<User> getTypeInvitationRecord(String baseId, String typeId);

    List<Map<String, String>> findAllInvitation(String userId);

    void executeSelection(String userId, String baseId, String selection);

    void deleteInvitationRecordByBaseId(String baseId);

    void deleteInvitationRecordByUserId(String userId, String baseId, String typeId);

    void deleteTypeInvitationRecord(String baseId, String typeId);

    void deleteAllInvitation(String userId);

    void deleteInvitationByBaseId(String userId, String baseId);

    List<User> getUsersByUserId(String userId);

    void updateBaseIdentityOfUser(String userId, Integer baseIdentity);

    List<User> getBaseMemberList(String userId, String baseId);

    void sackEmployeeByUserIdAndBaseId(String userId, String baseId, Integer baseIdentity);




    List<User> findAllAdmin();

    User findAdminByUserId(String userId);

    void UpdateRoleOfAdmin(String userId, Map RoleIdList);

    void updateBaseAdmin(String userId, String baseId, Integer baseIdentity);

    Result delBase(String baseId);

    List<User> getUserByBaseId(String BaseId);

    List<User> findBaseMemberByBaseId(String baseId);
}
